/*
 * FrontNavigationBar.fx
 *
 * Created on Feb 21, 2010, 7:17:33 PM
 */
package com.gpsbuddy.navigation.components;

import javafx.scene.CustomNode;
import javafx.scene.Node;
import javafx.geometry.HPos;
import com.gpsbuddy.components.MainMenuButton;
import javafx.scene.layout.VBox;
import com.gpsbuddy.graphics.settingsIconUI;
import com.gpsbuddy.graphics.positionIconUI;
import com.gpsbuddy.graphics.friendsUI;
import com.gpsbuddy.main.Main;
import com.gpsbuddy.graphics.serviceUI;
import com.gpsbuddy.main.Enviroment;

/**
 * @author jonycus
 */
public class FrontNavigationBar extends CustomNode {

    public-init var env: Enviroment;
    var possitionButton = MainMenuButton {
                label: "Possition";
                imageNode: positionIconUI { };
                override def onMouseClicked = function (event) {
                            Main.switchToPosition();
                        }
            }
    var settingsButton = MainMenuButton {
                label: "Settings";
                imageNode: settingsIconUI { };
                override def onMouseClicked = function (event) {
                            Main.switchToSettingsPage();
                        }
            }
    var serviceButton = MainMenuButton {
                label: "Account";
                imageNode: serviceUI { };
                override def onMouseClicked = function (event) {
                            Main.switchToServiceOptions();
                        }
            }
    var friendsButton = MainMenuButton {
                label: "Friends";
                imageNode: friendsUI { };
                override def onMouseClicked = function (event) {
                            Main.switchToFriendsPage();
                        }
            }
    
    var group = VBox {
                spacing: 20;
                nodeHPos: HPos.CENTER;
                content: [possitionButton, friendsButton, serviceButton, settingsButton]
            }

    override protected function create(): Node {
        return group;
    }

}
